#include "util.hpp"

namespace hms
{


template<typename EdgeType>
Index otherVertex(
	const EdgeBase<EdgeType>& edge,
	Index currentVertex
){
	return aux::otherEntry( edge.vertices(), currentVertex );
}


template<typename MeshType>
Index otherVertex(
	const MeshBase<MeshType>& mesh,
	Index edge,
	Index currentVertex
){
	return otherVertex( mesh.edge(edge), currentVertex);
}

template<typename EdgeType>
Index sharedVertex( const EdgeBase<EdgeType>& a, const EdgeBase<EdgeType>& b ){
	for ( auto vert : a.vertices() )
		if ( hms::hasEntry(b.vertices(), vert) )
			return vert;
	
	return signalCode::not_found;
}

} // end namespace hms